package anji.plus.system.mark.controller;

import anji.plus.system.mark.base.IBaseService;
import anji.plus.system.mark.base.BaseController;
import anji.plus.system.mark.domain.TaskNodeList;
import anji.plus.system.mark.dto.TaskListDto;
import anji.plus.system.mark.response.ResponseResult;
import anji.plus.system.mark.service.ISysUserService;
import anji.plus.system.mark.service.ITaskNodeListService;
import anji.plus.system.mark.vo.TaskListVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 任务节点表 前端控制器
 * </p>
 *
 * @author luwei
 * @since 2023-11-08
 */
@RestController
@RequestMapping("sys/taskNode")
public class TaskNodeListController extends BaseController {

    @Resource
    private ITaskNodeListService taskNodeListService;

    @Override
    public IBaseService getService() {
        return null;
    }


    // 查询 任务详情-查询
    @GetMapping({"details"})
    public ResponseResult queryTaskDetails(Long taskId){

        TaskListDto taskListDto = taskNodeListService.queryTaskDetails(taskId);
        return ResponseResult.success(taskListDto);
    }


    // 更新 节点信息
    @PostMapping({"updateDetails"})
    public ResponseResult updateTaskDetails(List<TaskNodeList> taskNodeList ){
        List<TaskNodeList> taskList = taskNodeListService.updateTaskDetails(taskNodeList);
        return ResponseResult.success(taskList);
    }


}
